package com.netmi.myjectpack.viewmodel;



import androidx.databinding.Bindable;
import androidx.databinding.library.baseAdapters.BR;

import com.netmi.myjectpack.bean.UserInfo;
import com.netmi.myjectpack.bean.UserInfoViewMole;

public class MyBaseViewModel extends ObservableViewModel {  //使用自定义viewmodel管理生命周期
    // Create a LiveData with a UserInfo
    private UserInfoViewMole userInfo;
    private String nickname;

    @Bindable
    public UserInfoViewMole getUserInfo() {
        return userInfo;
    }


    public void setUserInfo(UserInfoViewMole userInfo) {
        this.userInfo = userInfo;
    }

    public void updataData(){
//        notifyChange();
        notifyPropertyChanged(BR.userInfo); //使用局部刷新，需要在get方法标记@Bindable
    }


}
